﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<DrugStore.Models.ManageDiseaseModels>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Edit
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="main" runat="server">      
 <h2>Cập nhật bài thuốc</h2>
            <span style="color:Green"><%: ViewData["Message"] %></span>
            <form method="post" action="" enctype="multipart/form-data">
            <%: Html.ValidationSummary(true) %>
             <table class="formStyle1" width="95%">
                <tr>
                    <td colspan="2" valign="top" align="center"><img src="<%: Model.ImgPatch %>" alt="<%: Model.DiseaseName %>" title="image" style="max-width: 250px;" /></td>
                </tr>
                <tr>
                    <td width="100px;" valign="top"><%: Html.LabelFor(model => model.DiseaseName) %></td>
                    <td>
                        <%: Html.TextBoxFor(model => model.DiseaseName)%> * 
                        <%: Html.ValidationMessageFor(model => model.DiseaseName) %>
                    </td>
                </tr>   
                <tr>
                    <td valign="top"><%: Html.LabelFor(model => model.BriefDesc) %></td>
                    <td>
                        <%: Html.TextAreaFor(model => model.BriefDesc,10,50,null)%>
                        <%: Html.ValidationMessageFor(model => model.BriefDesc) %>
                    </td>
                </tr>    
                <tr>
                    <th><%: Html.LabelFor(model => model.DiseaseCategoryId) %></th>
                    <td>
                        <%: Html.DropDownListFor(model => model.DiseaseCategoryId, Model.Categories)%>                    
                        <%: Html.ValidationMessageFor(model => model.DiseaseCategoryId)%>
                    </td>
                </tr>
                <tr>
                    <td><%: Html.LabelFor(model => model.ImgPatch) %></td>
                    <td>
                        <input type="file" name="diseasePath" accept="image/png,image/jpeg,image/gif"/>
                    </td>
                </tr>  
                <tr>
                    <td valign="top"><%: Html.LabelFor(model => model.Content) %></td>
                    <td>
                       <%: Html.TextAreaFor(model => model.Content,10,50,null)%> 
                       <%: Html.ValidationMessageFor(model => model.Content)%>
                    </td>
                </tr>
                <tr>
                <td width="100px;" valign="top"><%: Html.LabelFor(model => model.SelectedNewsCategories)%></td>
                <td>
                   <% foreach (DrugStore.Models.Category c in Model.NewsCategories)
                      { %>
                        <span  class="news-category"><input type="checkbox" name="SelectedNewsCategories" value="<%: c.CategoryId %>" id="<%: c.CategoryId %>"
                         <% foreach (String s in Model.SelectedNewsCategories)
                           {
                               if (c.CategoryId.ToString().Equals(s, StringComparison.OrdinalIgnoreCase))
                               {%>
                                checked="checked"
                        <%}
                           } %>/>
                           <label for="<%: c.CategoryId %>"><%: c.Name %></label>
                           </span>
                   <% } %>
                   <p><%: Html.ValidationMessageFor(model => model.SelectedNewsCategories)%></p>
                </td>
            </tr>   
             <tr>
                <td>                
                </td>
                <td>
                    <input width="50px" type="submit" value="    Cập nhật    " />
                </td>
            </tr>      
            </table>
            </form>                       
             <script type="text/javascript">
                 CKEDITOR.replace('Content', {
                     fullPage: true,
                     extraPlugins: 'docprops'
                 });     
            </script>
</asp:Content>
